package com.cal.calonecal.controller;

import com.cal.calonecal.common.Response;
import com.cal.calonecal.pojo.entity.Tag;
import com.cal.calonecal.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 76004
 * @apiNote
 * @date 2023/6/17 21:11
 */
@RestController
@RequestMapping("/tag")
@CrossOrigin
public class TagController {
    @Autowired
    private TagService tagService;

    @PostMapping("/add")
    public Response<Void>add(@RequestBody Tag tag){
        return tagService.add(tag);
    }

    @GetMapping("/select-by-id")
    public Response<Tag>selectById(long id){
        return tagService.selectById(id);
    }
}
